<include file="Public:header" />
<include file="Public:leftside" />

<style>
	.file-item {
		float: left;
		position: relative;
		margin: 0 20px 20px 0;
		padding: 4px;
		background: #000;
	}
	
	.ee_span {
		background: #eee;
		height: 35px;
		display: block;
		line-height: 35px;
		padding-left: 9px;
	}
	.edit_ali{
		float: right;
    	background: #fd0909;
   		color: #fff;
    	padding: 1px 8px;
    	border-radius: 3px;
    }
    .phonecode {
    background: #F6F6F6;
    border: 1px solid #d9d9d9;
    cursor: pointer;
    padding: 0 8px;
    display: inline-block;
    line-height: 33px;
    height: 33px;
    color: #666;
    margin-left: 10px;
    text-align: center;
    width: 120px;
    vertical-align: middle;
}
</style>
<div class="main-content">
	<div class="breadcrumbs breadcrumbs-fixed" id="breadcrumbs">
		<ul class="breadcrumb">
			<li> <i class="icon-home home-icon"></i>
				<a href="#">首页</a>
			</li>
			<li>
				<a href="/Store/info/">店铺管理</a>
			</li>
			<li><a href="javascript:;">支付宝设置</a></li>

		</ul>
	</div>
	<div class="page-content" style="padding: 0;border: none;">

		<form action="{:U('Store/store_Save_ali')}" method="post" class="form form-horizontal" role="form">
			<div class="panel-body" style="padding: 0;border: none;">

				<div class="tab-content" style="padding: 16px 12px 55px 12px;">
					
					<section class="panel-default m-b-sm" style="margin:5px 0;">
						<div class="alert alert-info">
							<p>
								<i class="fa fa-hand-o-right m-r-xs"></i><strong>操作提示</strong>
							</p>
							<p class="alert-p m-l-xl"><i class="fa fa-caret-right m-r-xs"></i>该页面可对店铺结算支付宝设置进行添加编辑修改操作。</p>
						</div>
					</section>
					<div class="tab-pane fade active in" id="apply">
						<section class="panel panel-default">
							<header class="panel-heading font-bold"> 支付宝设置 </header>
							<div class="panel-body">

								<div class="form-group">
									<label class="col-sm-2 control-label">手机号</label>
									<div class="col-md-3">
										<input type="text" class="form-control" name="ali_phone" value="{$current.ali_phone}" readonly="readonly">
									</div>
								</div>
								<div class="line line-dashed line-lg pull-in"></div>
								<div class="form-group">
									<label class="col-sm-2 control-label">手机验证码</label>
									<div class="col-md-3">
										<input type="text" class="form-control" name="code" value="">
									</div>
									<a href="javascript:void(0);" class="phonecode">获取短信校验码</a>
								</div>
								<div class="line line-dashed line-lg pull-in"></div>
								<div class="form-group">
									<label class="col-sm-2 control-label">新支付宝账号</label>
									<div class="col-md-3">
										<input type="text" class="form-control" name="ali_number" value="{$current.ali_number}">
									</div>
								</div>
								<div class="line line-dashed line-lg pull-in"></div>
								<div class="form-group">
									<label class="col-sm-2 control-label">真实姓名</label>
									<div class="col-md-3">
										<input type="text" class="form-control" name="ali_name" value="{$current.ali_name}">
									</div>
								</div>
								<input type="hidden" name="id"  value="{$current.id}" />
								

							</div>
						</section>

						
						<div class="col-sm-4 col-sm-offset-2" style="margin-top: 10px;">
							<button class="formSubmit btn btn-primary btn-sm" id="form" value="保存" ajax="1" type="button">保存</button> &nbsp; &nbsp; &nbsp;
							<button class="btn btn-primary btn-sm btn-danger" value="取消" type="button" onclick="history.back(-1);">取消</button>
						</div>
					</div>
				</div>
			</div>

		</form>
	</div>
	<input type="hidden" id="company_ali_phone" value="{$current.ali_phone}">


	<script>
		//全局变量
		var GV = {
			DIMAUB: "/",
            JS_ROOT: "NewAdmin/js/",
			TOKEN: ""
		};
	</script>
	
	<script type="text/javascript" src="/NewAdmin/js/webuploader/webuploader.js"></script>
	<script type="text/javascript" src="/NewAdmin/js/webuploader/getting-started.js"></script>
	<link rel="stylesheet" href="/NewAdmin/css/webuploader.css" />
	<script src="/NewAdmin/js/wind.js"></script>
	<link href="/NewAdmin/js/artDialog/skins/default.css" rel="stylesheet" />
	<script src="/NewAdmin/js/zhlmy.js"></script>
	<script src="/NewAdmin/js/init_address.js"></script>
	<script type="text/javascript">
		var BASE_URL = '/NewAdmin/js/webuploader/';
		var UPLOAD_SERVER = '{:U("User/uploadify_wb")}';
		var UpFilePathInfo = '<?=$menuCurrent['
		UpFilePathInfo ']?>';
		$(function() {
			if($("#company_province_id").val() == null) {
				provice_id = 0;
			} else {
				provice_id = $("#company_province_id").val();
			}
			if($("#company_city_id").val() == null) {
				city_id = -1;
			} else {
				city_id = $("#company_city_id").val();
			}
			if($("#company_district_id").val() == null) {
				district_id = -1;
			} else {
				district_id = $("#company_district_id").val();
			}

			if(provice_id == 0) {
				initProvince('#seleAreaNext');
			} else {
				load('province', provice_id, 'city', city_id, 'district', district_id);
			}

			$('#uploader img').attr('src', UpFilePathInfo);
			$(':input[name="UpFilePathInfo"]').val(UpFilePathInfo);
			$("#uploader").setUploader(null, {
				uploadImgType: 'normal',
				thumb: {
					height: 102
				}
			});
		});
			
		// 获取验证码链接点击事件
	$(".phonecode").click(function() {
		

		// 获取短信验证码
		var target = this;

		var mobile = $("#company_ali_phone").val();
	
		$.post('/user/sms_captcha', {
			mobile: mobile,
		}, function(result) {
			if (result.code == 0) {
				layer.msg(result.message)
				
			} else {
				// 开始倒计时
				countdown(target, "获取短信验证码");
				layer.msg(result.message)
				
			}
			$(target).data("doing", false);
		}, "json");
	});
		var wait = 60;
		function countdown(obj, msg) {
			obj = $(obj);
	
			if (wait <= 0) {
				obj.prop("disabled", false);
				obj.html(msg);
				wait = 60;
			} else {
				if (msg == undefined || msg == null) {
					msg = obj.html();
				}
				obj.prop("disabled", true);
				obj.html(wait + "秒后重新获取");
				wait--;
				setTimeout(function() {
					countdown(obj, msg)
				}, 1000)
			}
		}
	
	

		
	</script>
	<include file="Public:footer" />